package ru.marketsoft.reminder.threads;

import ru.marketsoft.reminder.tools.AePlayWave;

import javax.swing.*;
import java.awt.*;

/**
 * User: dimka3210
 * Date: 28.02.13
 * Time: 23:54
 */
public class Dump {
    private static boolean newRunnable = true;

    private static Thread colorOverFlow;
    private static JLabel jLabel;
    private static Dump ourInstance = new Dump();
    private static TrayIcon trayIcon = new TrayIcon(Toolkit.getDefaultToolkit().getImage("ru/marketsoft/reminder/icon.png"));
    private static AePlayWave aePlayWave;

    public static TrayIcon getTrayIcon() {
        return trayIcon;
    }

    public static boolean isNewRunnable() {
        return newRunnable;
    }

    public static void setNewRunnable(boolean newRunnable) {
        Dump.newRunnable = newRunnable;
    }

    public static void setjLabel(JLabel jLabel) {
        Dump.jLabel = jLabel;
    }

    public static JLabel getjLabel() {
        return jLabel;
    }

    public static Dump getInstance() {
        return ourInstance;
    }

    public static void runColorOverFlow() {
        colorOverFlow = new Thread(new ColorOverflow(jLabel));
        colorOverFlow.start();
    }

    public static void stopColorOverFlow() {
        try {
            colorOverFlow.interrupt();
        } catch (Exception e) {
        }
    }

    public static AePlayWave getAePlayWave() {
        return aePlayWave;
    }

    public static void setAePlayWave(AePlayWave aePlayWave) {
        Dump.aePlayWave = aePlayWave;
    }
}
